import { Component } from '@angular/core';
import { FactoryOrValue } from 'rxjs';
import { FormControl } from '@angular/forms';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = '点击我';
  tdRowSpan: number = 3;
  tdRowSpanTxt: string = "当前不存在任何符合条件的数据。";
  divClass: string = "";
  isEnv: boolean = false;
  divClasses: any = {};
  divStyle: string = 'red';
  divStyles: any = {};
  value: string;
  keyword: string;
  keywordInput: FormControl = new FormControl();
  pipelineData: any;
  constructor() {
    setTimeout(() => {
      this.divClass = "bg-warning text-danger col-md-12 f-2";
      this.isEnv = true;
      this.divClasses = {
        'bg-success': true,
        'text-warning': true,
        'p-2': true,
        'font-italic': true
      };
      this.divStyle = "blue";
      this.divStyles = {
        "font-size": '30px',
        'background-color': 'red',
        'color': '#000'
      };
    }, 3000)
    this.keywordInput.valueChanges.subscribe(keyword => {
      this.keyword = keyword;
    });
    this.pipelineData = {
      string: "gainorloss",
      date: new Date(),
      num: 3.1415926
    };
  }
  doOnClick(e) {
    e.target.diabled = true;
    console.log(e, e.target.disabled);
  }
  doOnInput(e) {
    let domVal = e.target.value;
    let htmlVal = e.target.getAttribute('value');
    console.log(domVal, htmlVal);
  }
}
